package com.ctgu.common.config;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class MyMetaObjectHandler implements MetaObjectHandler {
    //插入时的填充策略
    @Override
    public void insertFill(MetaObject metaObject) {
        this.setFieldValByName("junkNum", 0, metaObject);
        this.setFieldValByName("unreadNum", 0, metaObject);
        this.setFieldValByName("popAddress", "pop.163.com", metaObject);
        this.setFieldValByName("smtpAddress", "smtp.163.com", metaObject);
        this.setFieldValByName("popPort", 995, metaObject);
        this.setFieldValByName("smtpPort", 994, metaObject);

    }

    //更新时的填充策略
    @Override
    public void updateFill(MetaObject metaObject) {

    }

}
